﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace BlackEagleWCF
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IDatingService
    {

        [OperationContract]
        void SendMessage(DirectMessageComposite dm);

        [OperationContract]
        List<DirectMessageComposite> GetMessages(Guid id);

        [OperationContract]
        void AddProfile(PersonComposite p);

        [OperationContract]
        PersonComposite GetProfile(Guid id);

        [OperationContract]
        void UpdateProfile(PersonComposite p);

        [OperationContract]
        void SendWallMessage(WallMessageComposite wm);

        [OperationContract]
        void FriendRequest(Guid friend1, Guid friend2);

        [OperationContract]
        void AcceptFriendRequest(Guid friend1, Guid friend2);

        [OperationContract]
        void DenyFriendRequest(Guid friend1, Guid friend2);

        [OperationContract]
        bool CheckForFriendship(Guid friend1, Guid friend2);

        [OperationContract]
        List<PersonComposite> GetFriendRequests(Guid id);

        [OperationContract]
        List<PersonComposite> SearchPersons(string name, int sex);

        [OperationContract]
        List<PersonComposite> GetFriends(Guid id);

        [OperationContract]
        List<PersonComposite> GetSpotlight();

        [OperationContract]
        List<WallMessageComposite> GetWallMessages(Guid id);

        [OperationContract]
        List<String> GetAuthors(List<Guid> users);

        [OperationContract]
        List<String> GetProfilePictures(List<Guid> users);

        [OperationContract]
        int CountNewMessages(Guid id);

        [OperationContract]
        int CountNewFriends(Guid id);

        [OperationContract]
        void MarkMessageAsRead(int id);

        // TODO: Add your service operations here
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
    [DataContract]
    public class PersonComposite
    {
        [DataMember]
        public Guid ID { get; set; }
        [DataMember]
        public string Fnamn { get; set; }
        [DataMember]
        public string Enamn { get; set; }
        [DataMember]
        public string PictureUrl { get; set; }
        [DataMember]
        public string Email { get; set; }
        [DataMember]
        public DateTime BirthDate { get; set; }
        [DataMember]
        public string PersonalDesc { get; set; }
        [DataMember]
        public int Sex { get; set; }
    }

    [DataContract]
    public class DirectMessageComposite
    {
        [DataMember]
        public int ID { get; set; }
        [DataMember]
        public string Title { get; set; }
        [DataMember]
        public string Content { get; set; }
        [DataMember]
        public Guid Sender { get; set; }
        [DataMember]
        public Guid Receiver { get; set; }
        [DataMember]
        public DateTime SendDate { get; set; }
        [DataMember]
        public bool IsRead { get; set; }
    }

    [DataContract]
    public class WallMessageComposite
    {
        [DataMember]
        public int ID { get; set; }
        [DataMember]
        public string Content { get; set; }
        [DataMember]
        public Guid Sender { get; set; }
        [DataMember]
        public Guid Receiver { get; set; }
        [DataMember]
        public DateTime SendDate { get; set; }
    }

    [DataContract]
    public class FriendshipComposite
    {
        [DataMember]
        public int ID { get; set; }
        [DataMember]
        public Guid Friend1 { get; set; }
        [DataMember]
        public Guid Friend2 { get; set; }
        [DataMember]
        public bool Confirmed { get; set; }
    }
}
